<?php
    //获取网站的site seo信息

    include_once("../../common/base.php");
    include_once("../../../config.php");

    //$_REQUEST=input_post();

    //看看发送过来的信息，是哪个网站
    $theme_folder=$_REQUEST['theme_folder'];

    //如果为空，直接返回错误信息
    if(empty($theme_folder))
    {
        echo output('faild 请输入网站名称',0);
        exit;
    }


// 判断是哪个字段
    if($_REQUEST['target']=="title")
    {
        $_data['ai_title']=$_REQUEST['content'];
    }
    if($_REQUEST['target']=="keyword")
    {
        $_data['ai_keyword']=$_REQUEST['content'];
    }
    if($_REQUEST['target']=="description")
    {
        $_data['ai_description']=$_REQUEST['content'];
    }


 //链接对应数据库
    include_once(ROOT_PATH_."/front/" . $theme_folder . "/connection.php");


    //$sql=update_date($table_Prefix."site",$_data,"nid",0);
    //执行
    $result=mysql_query($sql) or  die("Error:".mysql_error());

    $site_seo_info=select_one_line_all_items($table_Prefix."site","1 =1 ");

    //成功执行，则输出成功信息
    if($result)
    {
        echo output('success 更新成功',1);
    }
    else
    {
        echo output('faild 更新失败',0,$sql.$site_seo_info);
    }


    ?>
